package com.away.fuckingworld.controller;


import com.away.fuckingworld.entity.DoubleColorBallHistory;
import com.away.fuckingworld.entity.dto.AppearIntervalTimeCountDTO;
import com.away.fuckingworld.entity.dto.BallAnalyseDTO;
import com.away.fuckingworld.entity.dto.LabelValue;
import com.away.fuckingworld.entity.vo.ResultVO;
import com.away.fuckingworld.service.DoubleColorBallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RequestMapping("ssq")
@RestController
@Slf4j
@ApiOperation("双色球")
public class DoubleColorBallController {
    @Autowired
    private DoubleColorBallService doubleColorBallService;

    @RequestMapping("list")
    public List<DoubleColorBallHistory> SSQList() {
        List<DoubleColorBallHistory> doubleColorBallHistories = doubleColorBallService.listDCBHistory();
        return doubleColorBallHistories;
    }

    @GetMapping("lastestBlueInfo")
    public List<LabelValue> lastestBlueInfo(){
       return doubleColorBallService.lastestBlueInfo();
    }

    @GetMapping("maxIntervalBlueInfo")
    public List<LabelValue> maxIntervalBlueInfo(){
        return doubleColorBallService.maxIntervalBlueInfo();
    }
    @GetMapping("blueInfo")
    @ApiOperation(value="蓝球最大间隔期数排序后信息")
    public ResultVO<List<BallAnalyseDTO>> blueInfo(){
        return  new ResultVO<>(doubleColorBallService.blueInfoOrder());
    }

    @GetMapping("redInfo")
    @ApiOperation(value="红球最大间隔期数排序后信息")
    public ResultVO<List<BallAnalyseDTO>> redInfo(){
        return new ResultVO<>(doubleColorBallService.redInfoOrder());
    }

    @GetMapping("blueAppearIntervalTimeCount")
    @ApiOperation(value="获取篮球每次出现的间隔次数")
    public ResultVO<List<AppearIntervalTimeCountDTO>> blueAppearIntervalTimeCount(){
        return  new ResultVO<>(doubleColorBallService.blueAppearIntervalTimeCount());
    }
}
